package ex;

class Demo{
    int getElement(int[] arr,int index){
        int element = arr[index];
        return element;
    }
}
public class ExceptionDemo2 {
    public static void main(String[] args) {
        Demo demo = new Demo();
        int[] arr = {1,2,3};
        int element = demo.getElement(arr, 4);
        System.out.println("element = " + element);
        System.out.println("over");
    }
}
